package com.example.module_knowledge.presenter

import com.example.module_common.base.BaseModel
import com.example.module_common.base.BaseObserver
import com.example.module_common.base.BasePresenter
import com.example.module_common.model.KnowledgeModel
import com.example.module_knowledge.view.KnowLedgeView

class KnowLedgePresenter(knowLedgeView: KnowLedgeView): BasePresenter<KnowLedgeView>(knowLedgeView ) {
    fun tree(){
        addDisposable(apiServer.tree(), object : BaseObserver<BaseModel<List<KnowledgeModel.DataBean>>>(baseView) {
            override fun onSuccess(o: BaseModel<List<KnowledgeModel.DataBean>>) {
                baseView.onLoadTree(o.data!!)
            }


            override fun onError(msg: String?) {
                baseView.showError(msg!!)

            }
        })
    }
}